﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Portal/CustomerPortal.Master" AutoEventWireup="true" CodeBehind="InvoiceList.aspx.cs" Inherits="TireService.Business.Portal.FinanceView.InvoiceList" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <table cellpadding="0" cellspacing="2" border="0">
        <tr>
            <td>
                <img id="imgCar" alt="" src="~/Images/Medium/money.png" runat="server" style="width: 32px; height: 32px" />
            </td>
            <td valign="middle">
                <h3><asp:Label ID="lblInvoiceListHeader" runat="server" Text="Faktura"></asp:Label></h3>
            </td>
        </tr>
    </table>
    <hr />

    <!-- Javascript of action dropdown list -->
    <script language="javascript" type="text/javascript">

        // Function that handles actions selected in dropdown list
        function ActionClicked() {

            // Get selected action from dropdownlist
            var id = ddlAction.GetValue();

            if (id != null && id != 0) {


            }
            else {
                alert('Ingen handling valgt');
            }
        }

    </script>

    <table border="0" cellspacing="0" cellpadding="5" width="100%">
        <tr>
            <td style="width:150px">
                <dx:ASPxComboBox ID="ddlAction" ClientInstanceName="ddlAction" runat="server" Width="150px">
                    <Items>
                        <dx:ListEditItem Selected="true" Value="0" Text="-- Handling --" />
                    </Items>
                </dx:ASPxComboBox>
            </td>
            <td style="width:75px">
                <dx:ASPxButton ID="btnSubmitAction" runat="server" Text="Udfør" AutoPostBack="False" UseSubmitBehavior="False" Width="75px">
                    <ClientSideEvents Click="function(s, e) { ActionClicked(); }" />
                </dx:ASPxButton>
            </td>
            <td style="width:150px">
                <dx:ASPxComboBox ID="ddlExport" ClientInstanceName="ddlExport" runat="server" Width="150px">
                    <Items>
                        <dx:ListEditItem Selected="True" Value="0" Text="Export pdf" />
                        <dx:ListEditItem Value="1" Text="Export xls" />
                        <dx:ListEditItem Value="2" Text="Export csv" />
                        <dx:ListEditItem Value="3" Text="Export rtf" />
                    </Items>
                </dx:ASPxComboBox>
            </td>
            <td style="width:75px">
                <dx:ASPxButton ID="btnExport" runat="server" Text="Exporter" OnClick="btnExport_Click" Width="75px" >
                </dx:ASPxButton>
            </td>
            <td align="right">
                <asp:Label ID="lblPageSize" runat="server" Text="Antal linjer pr side"></asp:Label>
                <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="true">
                    <asp:ListItem Value="10">10</asp:ListItem>
                    <asp:ListItem Value="25">25</asp:ListItem>
                    <asp:ListItem Value="50">50</asp:ListItem>
                    <asp:ListItem Value="100">100</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <hr /> 

    <dxwgv:ASPxGridView ID="gvInvoice" runat="server" ClientInstanceName="gvInvoice" 
        KeyFieldName="Number" AutoGenerateColumns="False" EnableCallBacks="True" >
        <SettingsText EmptyDataRow="Ingen faktura'er" />
        <SettingsLoadingPanel Text="Henter&amp;hellip;" />
        <SettingsPager AlwaysShowPager="False" PageSize="10" Position="Bottom">
            <Summary 
                AllPagesText="Sider: {0} - {1} ({2} faktura'er)" 
                Text="Side {0} af {1} ({2} faktura'er)" />
        </SettingsPager>
        <SettingsBehavior ConfirmDelete="True" AllowGroup="true" AllowDragDrop="true" />
        <Columns>
            <dxwgv:GridViewDataHyperLinkColumn FieldName="Number" VisibleIndex="3" Caption="Vis faktura">
                <PropertiesHyperLinkEdit NavigateUrlFormatString="~/Portal/Popup/Invoice.aspx?InvoiceId={0}" Target="_blank" Text="Vis" >
                </PropertiesHyperLinkEdit>
            </dxwgv:GridViewDataHyperLinkColumn>
            <dxwgv:GridViewDataColumn FieldName="Number" VisibleIndex="4" Caption="Fakturanr">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="Date" VisibleIndex="4" Caption="Fakturadato">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="DueDate" VisibleIndex="4" Caption="Forfaldsdato">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="GrossAmount" VisibleIndex="5" Caption="Total">
            </dxwgv:GridViewDataColumn>
            <dxwgv:GridViewDataColumn FieldName="Remainder" VisibleIndex="5" Caption="Udestående">
            </dxwgv:GridViewDataColumn>
        </Columns>
        <Settings ShowFooter="True" />                     
        <TotalSummary>
            <dxwgv:ASPxSummaryItem FieldName="GrossAmount" SummaryType="Sum" />
            <dxwgv:ASPxSummaryItem FieldName="Remainder" SummaryType="Sum" />
        </TotalSummary>
    </dxwgv:ASPxGridView>

    <dx:ASPxGridViewExporter ID="gvExport" runat="server" GridViewID="gvInvoice">
    </dx:ASPxGridViewExporter>

</asp:Content>
